@extends('admin.adminbase')
@section('content')

	<style type="text/css">
	.form-control:read-only{
		background-color: #fff;
	}
	</style>

	<section class="hbox stretch">
		<aside>
			<section class="vbox">

				<header class="header bg-white b-b clearfix">
					<form class="talbe-search" method="get" action="">
						<div class="row m-t-sm">
							<div class="col-sm-12 m-b-xs">
								<div class="btn-group" role="group">
									<strong style="line-height:30px;">账号信息</strong>
								</div>
							</div>
						</div>
					</form>
				</header>

				<section class="scrollable  wrapper w-f">
					<section class="panel panel-default ">
						<div class="row m-l-none m-r-none bg-light lter">
							<div class="container" style="padding: 20px 0px">
								<form class="form-horizontal" style="padding-top: 15px;" method="post" action="{{url("admin/role/create")}}">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">账号：</label>
                                        <div class="col-sm-4 ">
                                            <input style="border: 0" type="text" class="form-control"  value="{{ $userInfo->account }}" readonly="readonly">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">姓名：</label>
                                        <div class="col-sm-4 ">
                                            <input style="border: 0" type="text" class="form-control" value="{{ $userInfo->name }}" readonly="readonly">
                                        </div>
                                    </div>
                                    <!--  
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">邮件：</label>
                                        <div class="col-sm-4 ">
                                            <input style="border: 0" type="text" class="form-control" value="{{ $userInfo->email }}" readonly="readonly">
                                        </div>
                                    </div>
                                    -->
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">电话：</label>
                                        <div class="col-sm-4 ">
                                            <input style="border: 0" type="text" class="form-control" value="{{ $userInfo->phone }}" readonly="readonly">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">状态：</label>
                                        <div class="col-sm-4 ">
                                            <input style="border: 0" type="text" class="form-control" value="{{ \App\Http\Util\Status::getLabel($userInfo->status) }}" readonly="readonly">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">角色：</label>
                                        <div class="col-sm-4 ">
                                            <input style="border: 0" type="text" class="form-control" value="{{ $roleName }}" readonly="readonly">
                                        </div>
                                    </div>
                                </form>
							</div>
						</div>

					</section>
				</section>
			</section>
		</aside>
	</section>
@endsection
@section('addscript')
	<script>
		$(function(){
             //操作父节点,子节点
             $("input:checkbox").on("click",function(){
                 var p_check = $(this).hasClass("selAll");
                 var isCheck = $(this)[0].checked;
                 //操作父节点
                 if(p_check && isCheck)
                 {
                     //子节点全选
                     var boxes = $(this).closest("div").next(".two_checkbox").find("input:checkbox");
                     boxes.each(function(){
                         $(this)[0].checked = true;
                     });
                 }
                 if(p_check && !isCheck)
                 {
                     //取消全选
                     var boxes = $(this).closest("div").next(".two_checkbox").find("input:checkbox");
                     boxes.each(function(){
                         $(this)[0].checked = false;
                     });
                 }

                 //操作子节点
                 if(p_check == false)
                 {

                     var boxes = $(this).closest(".two_checkbox").find("input:checkbox");
                     var allcheck = true;
                     var allnotcheck = true;
                     boxes.each(function(){
                         if($(this)[0].checked == false)
                         {
                             allcheck = false;
                         }
                         else
                         {
                             allnotcheck = false;
                         }
                     });

                     if(allcheck)
                     {
                         $(this).closest(".two_checkbox").prev(".check_item").find('input').prop('checked',true).trigger('change');
                     }
                    if(allnotcheck)
                    {
                        $(this).closest(".two_checkbox").prev(".check_item").find('input').prop('checked',false).trigger('change');
                    }
                 }
             });


		});
	</script>
@endsection
